# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=f3
pkgver=8.0
pkgrel=1
pkgdesc="F3 - Fight Flash Fraud"
url="http://oss.digirati.com.br/f3/"
arch="all"
license="GPL-3.0-only"
options="!check" # no test provided
makedepends="argp-standalone eudev-dev parted-dev linux-headers"
subpackages="$pkgname-doc $pkgname-extra"
source="$pkgname-$pkgver.tar.gz::https://github.com/AltraMayor/f3/archive/v$pkgver.tar.gz"

prepare() {
	default_prepare
	sed -i -e 's/\/usr\/local/\/usr/' Makefile
}

build() {
	LDFLAGS="$LDFLAGS -largp" make
	LDFLAGS="$LDFLAGS -largp" make extra
}

package() {
	make DESTDIR="$pkgdir" install
	make DESTDIR="$pkgdir" install-extra
}

extra() {
	pkgdesc="Extra tools for $pkgname"
	mkdir -p "$subpkgdir"/usr/bin
	for pkg in probe fix brew; do
		mv "$pkgdir"/usr/bin/$pkgname$pkg "$subpkgdir"/usr/bin/$pkgname$pkg
	done
}

sha512sums="4c929eb3ad56ffefff7ae3266148e2000e14f01553c1960ddbe77a164df18dda6f32980140b7568e32a3165f9362e4f43c990a946a62b15b06720d6f8b87f924  f3-8.0.tar.gz"
